package com.maxie.duck.demo.adapter;

import com.maxie.duck.demo.service.Duck;
import com.maxie.duck.demo.service.Turkey;

/**
 * 火鸡适配为鸭子
 */
public class TurkeyAdapter implements Duck {
    private Turkey turkey;
    public TurkeyAdapter(Turkey turkey) {
        this.turkey = turkey;
    }
    @Override
    public void squack() {
        turkey.gobble();
    }

    @Override
    public void fly() {
        turkey.fly();
    }
}
